package com.seu.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//等价于<bean id="user" class="com.seu.pojo.User"/>
//@Component 组件
@Component
@Scope("prototype")
public class User {

/*    //相当于<property name="name" value="霍建华"/>
    @Value("霍建华")*/
    public String name;

    //也可以用在set方法上
    @Value("霍建华")
    public void setName(String name) {
        this.name = name;
    }
}
